package test;

import java.io.Serializable;
import java.util.List;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable
public class Track implements Serializable {

	@Persistent
	@PrimaryKey
	private Long runID;
	/** running information **/
	@Persistent
	private double avgSpeed = 0;
	@Persistent
	private double distance = 0;
	@Persistent
	private double calories = 0;
	@Persistent
	private long time = 0;

	/************************/
	@Persistent
	private long date = 0;
	@Persistent
	private String name = null;
	@Persistent(serialized = "true")
	private List<GeoPtr> track = null;
	//@Persistent(serialized = "true")
	//private GeoPtr ptr =  new GeoPtr(1,2,3,4,5);

	public Track() { // needed for Serializable

	}

	public Track(long id, double speed, double distance, double calories,
			long time, List<GeoPtr> lst) {
		this.runID = id;
		this.setAvgSpeed(speed);
		this.setDistance(distance);
		this.setCalories(calories);
		this.setTime(time);
		// this.date = (Calendar.getInstance()).getTime().getTime();
		this.setTrack(lst);
		// this.name = DateFormat.getDateInstance().format(new Date(this.date));
	}

	public void setDate(long date) {
		this.date = date;
	}

	public long getDate() {
		return this.date;
	}

	public void setName(String name) {
		this.name = name;

	}

	public String getName() {
		return name;
	}

	public double getAvgSpeed() {
		return avgSpeed;
	}

	public void setAvgSpeed(double avgSpeed) {
		this.avgSpeed = avgSpeed;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}

	public double getCalories() {
		return calories;
	}

	public void setCalories(double calories) {
		this.calories = calories;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public List<GeoPtr> getTrack() {
		return track;
	}

	public void setTrack(List<GeoPtr> track) {
		this.track = track;
	}

	public Long getRunID() {
		return runID;
	}

	public void setRunID(Long runID) {
		this.runID = runID;
	}
/*
	public GeoPtr getPtr() {
		return ptr;
	}

	public void setPtr(GeoPtr ptr) {
		this.ptr = ptr;
	}*/
}
